/**
 * 
 */
package com.wolfpire.info.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wolfpire.info.dao.SchoolBaseInfoDao;
import com.wolfpire.info.model.SchoolBaseInfo;
import com.wolfpire.info.service.SchoolBaseInfoService;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.Page;
import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.system.common.base.service.impl.BaseHibernateService;

/**
 * @author lihd
 *
 */

@Service("schoolBaseInfoService")
public class SchoolBaseInfoServiceImpl extends
		BaseHibernateService<SchoolBaseInfo, Long> implements
		SchoolBaseInfoService {

	@Override
	public List<SchoolBaseInfo> list(SchoolBaseInfo schoolBaseInfo) {
		return this.schoolBaseInfoDao.list(schoolBaseInfo);
	}

	@Override
	public void del(Long id) {
		SchoolBaseInfo schoolBaseInfo = this.schoolBaseInfoDao.get(id);
		if (null != schoolBaseInfo) {
			schoolBaseInfo.setDelFlag(Constants.DELETE_FLAG);
			this.schoolBaseInfoDao.saveOrUpdate(schoolBaseInfo);
		}
	}

	@Override
	public Page<SchoolBaseInfo> setPageDataList(Page<SchoolBaseInfo> page,
			SchoolBaseInfo filterSchoolBaseInfo) {
		return this.schoolBaseInfoDao.findSchoolBaseInfos(page, filterSchoolBaseInfo);
	}
	
	@Override
	protected IBaseHibernateDao<SchoolBaseInfo, Long> getEntityDao() {
		return this.schoolBaseInfoDao;
	}
	
	@Resource private SchoolBaseInfoDao schoolBaseInfoDao;
}
